/*    */ package com.zimbra.cs.index;
/*    */ 
/*    */ import com.google.common.base.Objects;
/*    */ import com.google.common.base.Objects.ToStringHelper;
/*    */ import java.util.List;
/*    */ import org.apache.lucene.search.TopDocs;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ZimbraTopDocs
/*    */ {
/*    */   private final int totalHits;
/*    */   private final float maxScore;
/*    */   private final List<ZimbraScoreDoc> scoreDocs;
/*    */   
/*    */   protected ZimbraTopDocs(int totalHits, List<ZimbraScoreDoc> scoreDocs, float maxScore)
/*    */   {
/* 34 */     this.totalHits = totalHits;
/* 35 */     this.scoreDocs = scoreDocs;
/* 36 */     this.maxScore = maxScore;
/*    */   }
/*    */   
/*    */   public static ZimbraTopDocs create(int totalHits, List<ZimbraScoreDoc> scoreDocs, float maxScore) {
/* 40 */     return new ZimbraTopDocs(totalHits, scoreDocs, maxScore);
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public static ZimbraTopDocs create(int totalHits, List<ZimbraScoreDoc> scoreDocs)
/*    */   {
/* 47 */     return new ZimbraTopDocs(totalHits, scoreDocs, NaN.0F);
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public static ZimbraTopDocs create(TopDocs luceneTopDocs)
/*    */   {
/* 54 */     return new ZimbraTopDocs(luceneTopDocs.totalHits, ZimbraScoreDoc.listFromLuceneScoreDocs(luceneTopDocs.scoreDocs), luceneTopDocs.getMaxScore());
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public float getMaxScore()
/*    */   {
/* 62 */     return this.maxScore;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public int getTotalHits()
/*    */   {
/* 69 */     return this.totalHits;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public List<ZimbraScoreDoc> getScoreDocs()
/*    */   {
/* 76 */     return this.scoreDocs;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public ZimbraScoreDoc getScoreDoc(int index)
/*    */   {
/* 83 */     return (ZimbraScoreDoc)this.scoreDocs.get(index);
/*    */   }
/*    */   
/*    */   public String toString()
/*    */   {
/* 88 */     return Objects.toStringHelper(this).add("totalHits", this.totalHits).add("maxScore", this.maxScore).add("scoreDocs", this.scoreDocs).toString();
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/ZimbraTopDocs.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */